<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ include file="/WEB-INF/common/public.jspf"%>
<%@ include file="/WEB-INF/common/easyui.jspf"%>
<title>添加供应商</title>
<script type="text/javascript">
	$(function (){
		
		$("#addSupplier").form("disableValidation");
		$("#submit").click(function(){
			
			$('#addSupplier').form({    
			    url:"${baseUrl}/supplier/insertSupplier",    
			    onSubmit: function(){  
			    	
			    	$("#addSupplier").form("enableValidation");
					if(!$("#addSupplier").form("validate")){
						
						return false;
					}    
			    },    
			    success:function(data){  
			    	if(data.success){
				        parent.$("#win").dialog("close",true);
				    	parent.$.messager.alert('提示信息','供应商添加成功!','info');
			    	}else{
			    		parent.$.messager.alert('错误信息','供应商添加失败!','warning');
			    	}
			    }    
			});    

			$('#addSupplier').submit(); 
			
		
			
		});
		$("#reset").click(function (){
			
			$("#addSupplier").form("reset");
		});
		
		
	})

</script>

</head>
<body>

<form id="addSupplier" method="post" action="">   
    <div>   
        <label for="supName">提供商名称:</label>   
        <input class="easyui-validatebox" type="text" name="supName" data-options="required:true" />   
    </div>   
    <div>   
        <label for="supLinkman">联系人名称:</label>   
        <input class="easyui-validatebox" type="text" name="supLinkman" data-options="required:true" />   
    </div>   
     <div>   
        <label for="supPhone">联系电话:</label>   
        <input class="easyui-validatebox" type="text" name="supPhone" data-options="required:true" />   
    </div>
     <div>   
        <label for="supAddress">公司地址:</label>   
        <input class="easyui-validatebox" type="text" name="supAddress" data-options="required:true" />   
    </div> 
     <div>   
        <label for="supRemark">备注:</label>   
        <input class="easyui-validatebox" type="text" name="supRemark" data-options="required:true" />   
    </div>
     <div>   
        <label for="supType">提供商级别:</label>   
       	<select id="cc" class="easyui-combobox" name="supType" >   
		   
		    <c:forEach items="${applicationScope.sysParam.supType}" var="supType">
		    	 <option value="${supType.key}">${supType.value}</option>  
		    
		    </c:forEach>
		    
		    
		     
		</select>  

  
    </div>  
    <div>   
        <a id="submit"  class="easyui-linkbutton" >提交</a>
        <a id="reset"  class="easyui-linkbutton" >重置</a>
    </div>   
    
         
       
</form>  



</body>
</html>